<?php
/**
 * Created by PhpStorm.
 * User: qttx
 * Date: 2019/6/2
 * Time: 17:22
 */
namespace app\api\model;
class CityModel extends BaseModel
{
    protected $table = "xst_city";
    protected $rule = [
        'id' => '',
    ];
    protected $msg = [
        'id' => '',
    ];
    //省
    public function province()
    {
        return $this->field('id,name')->where('pid',0)->select();
    }
    //市
    public function city()
    {
        $id = request()->post('id');
        return $this->field('id,name')->where('pid',$id)->select();
    }
    //区
    public function area()
    {
        $id = request()->post('id');
        return $this->field('id,name')->where('pid',$id)->select();
    }
}